import request from '@/util/request'

// login  
export function login(data) {
    return request({
        url: '/user/login',
        method: 'post',
        data
    })
}

// register  
export function register(data) {
    return request({
        url: '/user/register',
        method: 'post',
        data
    })
}

// sendCode  
export function sendCode(email) {
    return request({
        url: '/user/sendCode?email=' + email,
        method: 'get',
    })
}


export function getUserInfo() {
    return request({
        url: '/user/info',
        method: 'get',
    })
}


export function getQRCode() {
    return request({
        url: '/wx/wxLogin',
        method: 'get',
        responseType: 'blob'
    })
}

export function checkQRCode(time) {
    return request({
        url: '/wx/checkQrStatus?time=' + time,
        method: 'get',
    })
}

export function bindEmailAndWechat(data) {
    return request({
        url: '/wx/bindAccount',
        method: 'post',
        data
    })
}